<?php render_partial("header1") ?>
<script type="text/javascript">
  function logOut(){
		var params = new Array();
		post_to_url("<?php echo $URL_BASE?>/user/delog", params, "post");
	}

function post_to_url(path, params, method) {
    method = method || "post"; // Set method to post by default, if not specified.

    // The rest of this code assumes you are not using a library.
    // It can be made less wordy if you use one.
    var form = document.createElement("form");
    form.setAttribute("method", method);
    form.setAttribute("action", path);

    for(var key in params) {
        if(params.hasOwnProperty(key)) {
            var hiddenField = document.createElement("input");
            hiddenField.setAttribute("type", "hidden");
            hiddenField.setAttribute("name", key);
            hiddenField.setAttribute("value", params[key]);

            form.appendChild(hiddenField);
         }
    }

    document.body.appendChild(form);
    form.submit();
}
</script>

<body>
  
<form id="Formulaire" method="post" action="<?php echo $URL_BASE?>/user/login">
  <p>
  <p><a href="#" onclick="logOut();">Log Out</a></p>
  <p><a href="<?php echo $URL_BASE ?>/user/index">User Interface</a></p>
</form>
 
<div id="tabla">
        <!-- <h1>Interface Admin</h1>-->

        <h2>Modification des informations</h2>
        
        <h3>Changer mail</h3>
        
        <form action="<?php echo $URL_BASE?>/user/modifyMail" method="POST">
            <table>
            <tr>
                <td class="label">
                    Mail :
                </td>
                <td class="label">
                    <?php echo $params['mail'] ?>
                </td>
            </tr>
            <tr>
                <td class="label">
                    New mail :
                </td>
                <td>
                    <input type="text" name="mail" value=""/>
                </td>
            </tr>
            <tr>
                <td> </td>
                <td><input type="submit" value="Modify"></td>
            </tr>
            </table>
        </form>
        
        <h3>Changer de mot de passe</h3>
        
        <form action="<?php echo $URL_BASE?>/user/modifyPassword" method="POST">
            <table>
            <tr>
                <td class="label">
                    Utilisateur :
                </td>
                <td class="label">
                    <?php echo $params['name'] ?>
                </td>
            </tr>
            <tr>
                <td class="label">
                    New password :
                </td>
                <td>
                    <input type="password" name="newPassword" value=""/>
                </td>
            </tr>
            <tr>
                <td> </td>
                <td><input type="submit" value="Modify"></td>
            </tr>
            </table>
        </form>
        
</div> 
</body>

<?php render_partial("footer1") ?>
